import functionnodes.FunctionNode;
import data.Value;

/**
 * @author loaner
 */
class functionnodes.FunctionNodeCreateClip extends FunctionNode {
	
	function FunctionNodeCreateClip() {
		super();
		funcname = "create-clip";
	}
	
	public function reduceValues( scope:Object, args:Array):Value
	{
		var name:String = args[0].raw();
		var depth:Number = args[1].raw();
		var mc:MovieClip = Evaluator.getNextEnclosingClip( scope );
		var clip:MovieClip = mc.createEmptyMovieClip( name, depth );
		var returnval:Value = new Value( Value.MOVIECLIP, clip );
		return returnval;
	}
}